﻿using System.Collections;
using System.Collections.Generic;

using Project.Model.Rights;
using Project.Model;
using System.Web;

namespace Project.IManager.Rights
{
    public interface IUserManager : IManagerBase<User>
    {
        #region   用户登录、验证
        /// <summary>
        /// 退出
        /// </summary>
        void SignOut();

        /// <summary>
        /// 登录
        /// </summary>
        void SetAuthCookie(string email, bool createPersistentCookie);

        /// <summary>
        /// 加密
        /// </summary>
        string HashPasswordForStoringInConfigFile(string password);
        User CurrentUser();

        /// <summary>
        /// 用户登录验证
        /// </summary>
        /// <param name="userName">用户名</param>
        /// <param name="password">密码</param>
        /// <param name="IsRememberMe">是否记住我</param>
        /// <returns>true:正确.false:错误</returns>
        bool Authenticate(string userName, string password, bool IsRememberMe);

        #endregion

        //User GetByName(string name);

        // 用户免费试用
        void FreeTrial(User user, UserProfile userProfile);

        /// <summary>
        /// 获取所有记录
        /// </summary>
        /// <returns></returns>
        IList<User> GetAll(User searchModel);

        /// <summary>
        /// 根据用户名查找用户
        /// </summary>
        /// <param name="UserName"></param>
        /// <returns></returns>
        User GetUserByName(string UserName);

    }
}
